<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN" dir="ltr">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN" dir="ltr">
<head profile="http://gmpg.org/xfn/11">
<title>AIS開発稟議書　GAEサンプル</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="Content-Language" content="ja" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />

<!-- <link rel="stylesheet" href="styles/layout.css" type="text/css" /> -->
<link type="text/css" href="styles/jquery-ui-1.7.3.custom.css" rel="stylesheet">
<link type="text/css" href="styles/uniform.default.css" media="screen" charset="utf-8" rel="stylesheet" />
<link type="text/css" href="styles/formlayout.css" media="screen" charset="utf-8" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="styles/global.css" />

<!-- ADD -->
<script type="text/javascript" src="scripts/top_up.js"></script>
<script type="text/javascript" src="TableFilter/tablefilter.js"></script>
<script type="text/javascript" src="scripts/jquery.quicksearch.js"></script>

<!-- CSS -->
<style type="text/css">
     #web a img { vertical-align:middle; }

</style>
<script type="text/javascript">
function edit(order_id){
    //frm.search_str.value=frm.shopname.value;
    //frm.type.value=frm.type_main.value;
    //frm.search_str.value=frm.shopname.value;
    //frm.type.value=frm.type_main.value;
    
    frmMain.action="/create_new?order_number=" + order_id;
    
    //frmMain.action="/create_new_detail?order_number=" + order_id;
    //frmMain.method="get";
    
    //frmMain.action="/create_new_detail";
    //frmMain.form_order_number.value = order_id;
    frmMain.submit();
}
function outCsvFile(){
	var str = "";
    var tbl = document.getElementById("table_exp");
    // 行に対するループ
    var rows = tbl.rows;
    for (var i=2, len=rows.length; i<len; i++) {
		if (rows[i].style.display != 'none') {
			if (str != "") 
				str = str + ",";
			
			//オーダーNOを取得
			str = str + rows[i].cells[1].innerText;
		}
   	}  

    frmMain.action="/CsvFile?outputKey=" + str;
    frmMain.method="post";
    //frmMain.target="_blank";
    frmMain.submit();
}
</script>
<!-- JS -->
<!--<script type="text/javascript" src="scripts/jquery-1.7.1.min.js"></script>-->
<script type="text/javascript">
$(function () {
 $('table#table_exp tbody tr').quicksearch({
    position: 'before',
    attached: 'table#table_exp',
    stripeRowClass: ['odd', 'even'],
    labelText: '全項目検索：'
 });
 $('ul#list_exp li').quicksearch({
    position: 'before',
    attached: 'ul#list_exp',
    loaderText: '',
    delay: 100,
    labelText: '全項目検索：'
 });
});
 TopUp.addPresets({
    "#web a ": {
       group:"web"
    }
 });
</script>
<script language="javascript" type="text/javascript"> 
//<![CDATA[
	/*** IE only: show/hide selects during filtering operations ***/
	function hideIESelects(o)
	{
		if(tf_isIE)
		{
			var slc = o.tbl.getElementsByTagName('select');
			slc[0].style.visibility = 'hidden';
		}
	}
	
	function showIESelects(o)
	{
		if(tf_isIE)
		{
			var slc = o.tbl.getElementsByTagName('select');
			slc[0].style.visibility = 'visible';
		}
	}
//]]>
</script>
<!-- -->
</head>
<body>

<table width="1020" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <td>
    <table width="300px" border="0" align="rigth" cellpadding="0" cellspacing="0" class="mycss">
      <tr>
      	<td></td>
       	<td width="210" valign="top">
            	<div align="right">{% if current_user %}
              Hello,{{ current_user }}
              {% else %}
              ログインして下さい
              {% endif %}
              <!-- 注意：　%}のフォーマット！！ -->
              <a href="{{ url }}">{{ url_linktext }}</a>
			  </div>
			</td>
      </tr>
    </table></td>
  </tr>
</table>
<form id="frmMain" name="frmMain" method="post" action="/create_new">
  <p>
    <label for="create_new"></label>
  </p>
  <p>
  {% if current_user %}
    &nbsp;<input type="submit" class="submit" name="create_new" id="create_new" value="新規" />
    &nbsp;<input type="button" class="submit" name="btnCsv" id="btnCsv" value="出力" onclick="outCsvFile()" />
    {% endif %}
  </p>
  <table id="table_exp" width="100%" border="1" align="center" cellpadding="1" cellspacing="0">
  	<thead>
    <tr>
      <th width="8%" class="title" nowrap="">ステータス</th>
      <th width="11%" class="title" nowrap="">依頼書NO.</th>
      <th width="8%" class="title" nowrap="">依頼者</th>
      <th width="12%" class="title" nowrap="">依頼日付</th>
      <th width="9%" class="title" nowrap="">企業コード</th>
      <th width="28%" class="title" nowrap="">企業名</th>
      <th width="5%" class="title" nowrap="">添付</th>
    </tr>
	</thead>
    {% if current_user %}
	<tbody>
    	{% for sumdata in view_data %}
    <tr>
      <td align="center">{{ sumdata.confirm_status }}</td>
      <td align="center"><a href="#" onClick="edit({{ sumdata.order_number }})">{{ sumdata.order_number }}</a></td>
      <td>{{ sumdata.order_author }}</td>
      <td>{{ sumdata.order_date|date:"Y年m月d日" }}</td>
      <td>{{ sumdata.company_code }}</td>
      <td>{{ sumdata.company_name }}</td>
	  <td>
<div id="web" name="web">
		<a href="/fileblob?order_number={{ sumdata.order_number }}" toptions="width=600,height=500,type=iframe,overlayClose=1,title=添付ファイル,shaded=1,layout=dashboard" onClick="">選択</a>
</div>
      </td>
    </tr>
    	{% endfor %}
	</tbody>
	{% else %}
	<br /><b><font size=15 color="Red">
		ログインして下さい。</font></b>
	{% endif %}
  </table>

  <input type="hidden" name="form_order_number" />
  <p>&nbsp;</p>
</form>
<p>&nbsp;</p>
<script language="javascript" type="text/javascript">
//<![CDATA[	
	var props = {
		sort: true,
		sort_config: {
			sort_types:['String','String','String','String','String','String']
		},
		remember_grid_values: true,
		alternate_rows: true,
		rows_counter: true,
		rows_counter_text: "Displayed rows: ",
		btn_reset: true,
		btn_reset_text: "Clear",
		btn_text: " > ",
		loader: true,
		loader_text: "Filtering data...",
		loader_html: '<IMG alt="" src="images/top_up/loader.gif" ?style="vertical-align:middle;" + ?> Loading...',
		on_show_loader: hideIESelects, //IE only: selects are hidden when loader visible
		on_hide_loader: showIESelects, //IE only: selects are displayed when loader closed
		col_0: "select",
		col_6: "none",
		display_all_text: "< Show all >"
	}
	var tf = setFilterGrid("table_exp",props);
//]]>
</script>


</body>